package Concurrent.countDownLatch.wait.latch;

import java.util.concurrent.CountDownLatch;

/**
 * Created by wangyg6 on 2017/11/29.
 */
public class TaskThree implements Runnable {

	private CountDownLatch latch;

	public TaskThree(CountDownLatch latch) {
		this.latch = latch;
	}

	@Override
	public void run() {
		try {
			Thread.sleep((long) Math.random() * 1000);
			System.out.println("Task three execute complete");
			latch.countDown();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
